package businessObjects;

import java.sql.SQLException;
import java.util.ArrayList;

import connection.ConnectionDAO;
import connection.JDCConnection;

import dao.HistoriqueDAO;

import model.Resultat;
import model.Session;

public class HistoriqueBo {
	
	private HistoriqueDAO dao;
	private ConnectionDAO con;
	
	public HistoriqueBo() {
		dao = new HistoriqueDAO();
		con = new ConnectionDAO();
	}
	
	public double getMoyenneCumulative(int idEtudiant) throws SQLException {
		JDCConnection c = con.getConnection();
		return dao.getMoyenneCumulative(c, idEtudiant);
	}
	
	public ArrayList<Session> getResultatByIdEtudiant(int idEtudiant) throws SQLException {
		JDCConnection c = con.getConnection();
		return dao.getResultatByIdEtudiant(c, idEtudiant);
	}
	
	public ArrayList<Resultat> getCoursBySession(int idEtudiant, int idSession) throws SQLException {
		JDCConnection c = con.getConnection();
		return dao.getCoursBySession(c, idEtudiant,idSession);
	}
	
}
